package org.springblade.modules.repair.vo.statistics;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;


/**
 * @Description
 * @Author ysq
 * @Date 2022/8/26
 **/
@Data
public class DeptUserWorkDetailVO {

	@ApiModelProperty(value = "用户id")
	private Long userId;

	@ApiModelProperty(value = "用户名")
	private String userName;

	@ApiModelProperty(value = "保养作业工单数")
	private long byOrderCount;

	@ApiModelProperty(value = "维修作业工单数")
	private long wxOrderCount;

	@ApiModelProperty(value = "配件作业工单数")
	private long pjOrderCount;

	@ApiModelProperty(value = "保养作业累计作业时长")
	private BigDecimal byWorkHour;

	@ApiModelProperty(value = "维修作业累计作业时长")
	private BigDecimal wxWorkHour;

	@ApiModelProperty(value = "配件作业累计作业时长")
	private BigDecimal pjWorkHour;

	@ApiModelProperty(value = "合计累计作业时长")
	private BigDecimal totalWorkHour;

	public BigDecimal getByWorkHour() {
		if (this.byWorkHour == null) {
			this.byWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return byWorkHour;
	}

	public void setByWorkHour(Integer byWorkHour) {
		this.byWorkHour = new BigDecimal(byWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getWxWorkHour() {
		if (this.wxWorkHour == null) {
			this.wxWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return wxWorkHour;
	}

	public void setWxWorkHour(Integer wxWorkHour) {
		this.wxWorkHour = new BigDecimal(wxWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getPjWorkHour() {
		if (this.pjWorkHour == null) {
			this.pjWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return pjWorkHour;
	}

	public void setPjWorkHour(Integer pjWorkHour) {
		this.pjWorkHour = new BigDecimal(pjWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getTotalWorkHour() {
		if (this.totalWorkHour == null) {
			this.totalWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return totalWorkHour;
	}

	public void setTotalWorkHour(Integer totalWorkHour) {
		this.totalWorkHour = new BigDecimal(totalWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}
}
